import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@Injectable({
  providedIn: 'root',
})
export class ReadingService {
  public isPlayingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null);
  public triggerSourceSubject: BehaviorSubject<string> = new BehaviorSubject<string>(null);

  public currentIndex = 0;
  public currentChapterNo = 1;

  private triggerSourceValue = 'player';

  public get triggerSource() {
    return this.triggerSourceValue;
  }
  public setTriggerSource(value: string) {
    this.triggerSourceValue = value;
    this.triggerSourceSubject.next(value);
  }
}
